package main

import "fmt"

func swap(a, b int) (int, int) {
	a, b = b, a
	return a, b
}
func swap2(a *int, b *int) {
	*a, *b = *b, *a
}

func main() {
	a, b := 1, 2
	fmt.Println(a, b)
	swap(a, b)
	fmt.Println(a, b)
	a, b = swap(a, b)
	fmt.Println(a, b)
	swap2(&a, &b)
	fmt.Println(a, b)
}
